Symbolic Resource Bound Inference for Functional Programs
نویسندگان
چکیده
We present an approach for inferring symbolic resource bounds for purely functional programs consisting of recursive functions, algebraic data types and nonlinear arithmetic operations. In our approach, the developer specifies the desired shape of the bound as a program expression containing numerical holes which we refer to as templates. For e.g, time ≤ a ∗ height(tree) + b where a, b are unknowns, is a template that specifies a bound on the execution time. We present a scalable algorithm for computing tight bounds for sequential and parallel execution times by solving for the unknowns in the template. We empirically evaluate our approach on several benchmarks that manipulate complex data structures such as binomial heap, lefitist heap, red-black tree and AVL tree. Our implementation is able to infer hard, nonlinear symbolic time bounds for our benchmarks that are beyond the capability of the existing approaches.
منابع مشابه
Ranking Functions for Loops with Disjunctive Exit-Conditions
Finding ranking functions for the loops in a program is a prerequisite for proving its termination and analysing its resource usage. From its ranking function one easily derives a symbolic upper bound on the number of iterations of a loop. Such symbolic loop bounds can be used to derive concrete time and memory-usage bounds for complete programs. This paper builds upon an earlier paper in which...
متن کاملBounded Expectations: Resource Analysis for Probabilistic Programs
Following the increasing relevance of probabilistic programming, there is a renewed interest in addressing the challenges that probabilistic code bears for static reasoning. For example, there are successful techniques for automatic worst-case resource analysis but these techniques are not applicable to many probabilistic programs, which, for instance, only terminate almost surely. This paper p...
متن کاملFunctional languages and very ne grained parallelism: Initial results
A functional language compiler can be used as a powerful tool in the scheduling of programs for hardware capable of ne grained instruction level parallelism. There have been many attempts to eeectively utilise functional languages as a means of easily programming parallel hardware. These attempts have generally concentrated on parallelising the underlying reduction strategies to achieve this go...
متن کاملA Multivariate Amortized Resource Analysis
We study the problem of automatically analyzing the worst-case resource usage of procedures with several arguments. Existing automatic analyses based on amortization, or sized types bound the resource usage or result size of such a procedure by a sum of unary functions of the sizes of the arguments. In this paper we generalize this to arbitrary multivariate polynomial functions thus allowing bo...
متن کاملAmortized Resource Analysis with Polynomial Potential A Static Inference of Polynomial Bounds for Functional Programs (Extended Version)
In 2003, Hofmann and Jost introduced a type system that uses a potential-based amortized analysis to infer bounds on the resource consumption of (first-order) functional programs. This analysis has been successfully applied to many standard algorithms but is limited to bounds that are linear in the size of the input. Here we extend this system to polynomial resource bounds. An automatic amortiz...
متن کامل